package com.projectName.www.dao;

import com.projectName.www.po.dishes;
import com.projectName.www.util.String_util;

import javax.swing.*;

public class S_J_insertdishes_dao {
    public static  boolean insertdishes(dishes d) throws Exception {
        if(String_util.isEmpty(d.getName())){
            JOptionPane.showMessageDialog(null,"名字不能为空");
            return false;
        }
        String sql="insert ignore into dishes(money,name,des,shopname) values(?,?,?,?)";
        int i= BaseDao.executeUpdata(sql,d.getMoney(),d.getName(),d.getDes(), d.getShopname());

        if(i>0){return true;}
        else {
            return false;
        }
    }
}
